﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ThermalEquipmentDesign.Model;
using System.Windows.Input;
using ThermalEquipmentDesign.Model.CoolingTower;

namespace ThermalEquipmentDesign.ViewModel
{
    class CoolingTowerViewModel : ObservableObject
    {
        
        private CoolingTower oCoolingtower = new CoolingTower();
        private CoolingtowerResult oresult = new CoolingtowerResult();
        private CoolingTowerModel oCoolingTowerModel;
        private ICommand calculate;

        internal CoolingtowerResult oResult
        {
            get { return oresult; }
            set
            {
                if (value != oresult)
                {
                    oresult = value;
                    OnPropertyChanged("oresult");
                }
            }
        }

        //

        public CoolingTower ocoolingTower
        {
            get { return oCoolingtower; }
            set
            {
                if (value != oCoolingtower)
                {
                    oCoolingtower = value;
                    OnPropertyChanged("oCoolingtower");
                }
            }
        }
        //
        public ICommand Calculate
        {
            get
            {
                if (calculate == null)
                {
                    calculate = new RelayCommand(
                        param => ImplementCalculation()
                    );
                }
                return calculate;
            }
        }
        //
        public void ImplementCalculation()
        {
            CoolingTowerModel coolingModel = new CoolingTowerModel();
            oresult = coolingModel.ImplementCalculation(oCoolingtower);
             
            
        }
    }
}
    

